// Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.

// 弹性伸缩策略查询结构体定义
package policy

type ListResponse struct {
	TotalCount      int             `json:"total_count"`
	Count           int             `json:"count"`
	ScalingPolicies []ScalingPolicy `json:"scaling_policies"`
}

type ListRelationResp struct {
	Count    int        `json:"count"`
	Relation []Relation `json:"relation"`
}

type Relation struct {
	FleetName         string `json:"fleet_name"`
	FleetId           string `json:"fleet_id"`
	ScalingPolicyName string `json:"scaling_policy_name"`
	ScalingPolicyId   string `json:"scaling_policy_id"`
	ScalingGroupId    string `json:"scaling_group_id"`
}

type AssociatedFleetOfPolicy struct {
	Name                string `json:"name"`
	FleetId             string `json:"fleet_id"`
	State               string `json:"state"`
	InstanceCount       int    `json:"instance_count"`
	ProcessCount        int    `json:"process_count"`
	ServerSessionCount  int    `json:"server_session_count"`
	MaxServerSessionNum int    `json:"max_server_session_count"`
}

type AssociatedPolicyOfFleet struct {
	Id                       string                   `json:"id"`
	Name                     string                   `json:"name" validate:"required,min=1,max=1024"`
	PolicyType               string                   `json:"policy_type" validate:"required,oneof=TARGET_BASED"`
	TargetBasedConfiguration TargetBasedConfiguration `json:"target_based_configuration"`
}

// 通过伸缩策略list
type PolicyListResp struct {
	Count                       int                       `json:"count"`
	AssociatedPolicyOfFleetList []AssociatedPolicyOfFleet `json:"associated_policy_of_fleet_list"`
}

// 通过fleetId list
type FleetListResp struct {
	Count                       int                       `json:"count"`
	AssociatedFleetOfPolicyList []AssociatedFleetOfPolicy `json:"associated_fleet_of_policy_list"`
}
